<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
      <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
      <title>我的订单</title>
      <link rel="stylesheet" href="../../../css/aui.css"/>
      <link rel="stylesheet" href="../../../css/iconfont/iconfont.css" />
  </head>
  <body>
      <header class="aui-bar aui-bar-nav" id="header">
          <a class="aui-pull-left aui-btn">
              <span class="aui-iconfont aui-icon-left" onclick="closeWin()"></span>
          </a>
          <div class="aui-title">全部订单</div>
          <a class="aui-pull-right aui-btn">
              <span class="aui-iconfont aui-icon-home" onclick="goHome()"></span>
          </a>
      </header>

      <footer class="aui-bar aui-bar-tab" id="footer">
          <div class="aui-bar-tab-item aui-active" tapmode>
              <i class="iconfont icon-feiji1"></i>
              <div class="aui-bar-tab-label">机票</div>
          </div>
          <div class="aui-bar-tab-item" tapmode>
              <i class="iconfont icon-huochepiao"></i>
              <div class="aui-bar-tab-label">火车票</div>
          </div>
          <div class="aui-bar-tab-item" tapmode>
              <i class="iconfont icon-jiudian"></i>
              <div class="aui-bar-tab-label">酒店</div>
          </div>
      </footer>
  </body>
</html>
<!--列表模板 end-->
<script src="../../../script/aui/api.js"></script>
<script src="../../../script/extend/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="../../../script/common.js"></script>
<script src="../../../script/aui/aui-tab.js"></script>
<script type="text/javascript">
    apiready = function() {
        api.parseTapmode();
        //设置高度
        var header = $api.byId('header');
        $api.fixStatusBar(header);
        $api.fixTabBar($api.byId('footer'));
        var headerPos = $api.offset(header),
            frameheight = api.winHeight - $api.byId('header').offsetHeight - $api.byId('footer').offsetHeight;
        api.openFrame({
            name: 'all_orders_frm',
            url: './all_orders_frm.html',
            rect: {
                x: 0,
                y: headerPos.h,
                w: 'auto',
                h: frameheight
            },
            pageParam: {
                name: 'test'
            },
            // bounces: true,
            bgColor: 'rgba(0,0,0,0)',
            vScrollBarEnabled: true,
            hScrollBarEnabled: true
        });

        var tab = new auiTab({
            element: document.getElementById("footer"),
            index: 1,
            repeatClick: false
        }, function(tab) {
            var productId = 1;
            switch (tab.index) {
                case 1:
                    productId = 1;
                    break;
                case 2:
                    productId = 5;
                    break;
                case 3:
                    productId = 3;
                    break;
            }
            //发送监听
            api.sendEvent({
                name: 'orderEv',
                extra: {
                    product_id: productId,
                }
            });
        });

    }
    function closeWin(){
      api.closeWin();
    }
    function goHome(){
      api.closeToWin({
          name: 'main'
      });
    }
</script>
